<template>
  <div class="dv">
    <p>{{ msg }}</p>
  </div>
</template>
<script>
export default{
  data() {
    return {
     msg: "Vue.js",
      };
    },
 beforeCreate(){
        console.log("实例创建前: " + this.msg);
  },
  created() {
    console.log("实例创建后" + this.msg);
  },
};
// import { onBeforeMount, onMounted } from 'vue';

// onBeforeMount(() =>{
//     console.log("Dom元素渲染之前", document.querySelector(".dv"));
    
// });
// onMounted(() =>{
//     console.log("Dom元素渲染之后", document.querySelector(".dv"));
    
// });
</script>
<style>
</style>